All Objects
Link Object
Link.hash
Link.hostname
Link.href
Link.pathname
Link.port
Link.protocol
Link.search
PROPERTY: Link::host
object.
host
host
is a property of both the
Link
and the
Location
objects and is a string comprising of the
hostname
and
port
strings. If the
port
property is the default of 80, then the
hostname
property is the same as the
host
property. Assuming a link (stored in the first element of the
links
property) to a URL ...
http://home.newco.com/products/enquiries.htm#local?email=name@otherco.com
...the following code would display the
host
property of it:
Code:
document.write(document.links[0].host)
Output:
home.newco.com:80
NOTE:
Although the
host
property can be set at any time, it is safer to set the
href
property to change a link.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information